package com.zto.sch.base.normal;

import cn.hutool.core.date.StopWatch;
import org.junit.Test;

import java.util.concurrent.TimeUnit;

public class StopWatchTest {
    @Test
    public void test() throws InterruptedException {
        StopWatch sw = new StopWatch();

        sw.start("A");
        Thread.sleep(500);
        sw.stop();
        sw.start("B");
        Thread.sleep(300);
        sw.stop();
        sw.start("C");
        Thread.sleep(200);
        sw.stop();

        System.out.println(sw.prettyPrint(TimeUnit.MILLISECONDS));
    }
}
